#include <time.h>

#include "Players.h"

double turnlength;
double turnmargin;
time_t last;

void timerINIT(void)
{
	last = time(NULL);
	turnlength = 30;
	turnmargin = 1;
}

void timer(void)
{
	while (difftime(time(NULL), last) < turnlength)
	{
		if (difftime(time(NULL), last) < (turnlength - turnmargin))
		{
			players();
		}
	}
	last = time(NULL);
}
